{{useCss "/app-pages/css/pay.scss"}}
<div class="fcart">
    <!-- 收货人信息,支付方式，商品清单 -->
    <div class="ftitle">支付订单</div>

    <div class="order_detail">
        <div class="titleindex">填写并核对订单信息{{aa}}</div>

        <div class="item">
            <div class="title2">收货信息</div>
            <div class="info">
                <div class="addr">
                    <div class="useaddr">
                        {{#if user.pay_ach.info.user_address}}
                        <h4>当前选择的收货地址：</h4>
                        <span>
                            {{user.pay_ach.info.user_address.name}}， {{user.pay_ach.info.user_address.mobilenumber}}， {{user.pay_ach.info.user_address.province}} {{user.pay_ach.info.user_address.town}} {{user.pay_ach.info.user_address.county}}， {{user.pay_ach.info.user_address.detail}}
                        </span>
                        {{#else}}
                        <p>请选择收获地址</p>
                        {{/if}}
                    </div>
                </div>
                {{#if user.pay_ach.info.state==$Top.config.ACH_STATE.未确认}} {{#each user.address_detail}}
                <div class="addr">
                    <label style="cursor: pointer;">
                        <input type="radio" name="addr" checked="{{$Top.user.pay_ach.info.user_address._id}}" value="{{_id}}" event-click="{{'$Top.$Event.pay.change_user_address'}}" />
                        <span>
                            {{name}}，{{mobilenumber}} {{phonenumber&&("/"+phonenumber)}}，{{province}}{{town}}{{county}}，{{detail}}</span>
                    </label>
                </div>
                {{/each}}
                <div class="add_address">
                    <div class="text">
                        <div class="addr">
                            <select class="province" name="province" event-change={{ '$Event.province'}}>
                                <option class="first" value="0">请选择省</option>
                                {{#each city_list}}
                                <option rel="{{region_id}}" value="{{region_name}}">
                                    {{region_name}}
                                </option>
                                {{/each}}
                            </select>

                            <select class="city" name="city" disabled event-change={{ '$Event.city'}}>
                                <option class="first" value="0">请选择市</option>
                            </select>

                            <select class="county" name="area" disabled>
                                <option class="first" value="0">请选择地区</option>
                            </select>

                            <input type="text" class="detailed_addre" title="详细地址" name="detailed_addre" placeholder="详细地址" maxlength="25" />
                        </div>

                        <div class="connect">
                            <input type="text" name="name" class="name" placeholder="收货人" title="收货人" maxlength="12" />
                            <input type="text" name="mobile_num" class="mobile_num" title="联系手机" placeholder="联系手机" maxlength="11" />
                            <input type="text" name="phone_num" title="座机号码" class="phone_num" placeholder="座机号码" maxlength="11" />
                        </div>
                    </div>

                    <div class="btn">
                        <button event-click="{{'$Event.pay.add_user_address'}}">添加地址</button>
                    </div>
                </div>
                {{/if}}
            </div>
        </div>

        <div class="item">

            <div class="title2">支付方式： {{#if user.pay_ach.info.pay_method==config.PAY_METHOD.担保交易}} 使用支付宝的快捷支付 {{/if}} {{#if user.pay_ach.info.pay_method==config.PAY_METHOD.货到付款}} 货到付款 {{/if}} {{#if user.pay_ach.info.pay_method==config.PAY_METHOD.当面付款}} 当面付款 {{/if}} {{#if user.pay_ach.info.pay_method==config.PAY_METHOD.微信支付}} 微信支付 {{/if}}
            </div>
            {{#if user.pay_ach.info.state==$Top.config.ACH_STATE.未确认}}
            <div class="info">
                <div class="pay-type">
                    <label style="cursor: pointer;">
                        <input checked="{{user.pay_ach.info.pay_method}}" type="radio" bind-input="{{'$Cache.pays.buy_method'}}" name="pay-type" value="partner_trade_by_buyer" event-change="{{'$Event.pay.change_pay_method'}}" disabled="{{!(bus_info.info.alipay.seller_email&&bus_info.info.alipay.key&&bus_info.info.alipay.partner)}}" />支付宝
                        <span>使用支付宝的快捷支付</span>
                    </label>
                </div>
                <div class="pay-type">
                    <label style="cursor: pointer;">
                        <input checked="{{user.pay_ach.info.pay_method}}" type="radio" bind-input="{{'$Cache.pays.buy_method'}}" name="pay-type" value="payment_in_cash" event-change="{{'$Event.pay.change_pay_method'}}" disabled="{{user.pay_ach.info.is_only_online_pay}}" />货到付款
                        <span>用于大金额订单</span>
                    </label>
                </div>
                <div class="pay-type">
                    <label style="cursor: pointer;">
                        <input checked="{{user.pay_ach.info.pay_method}}" type="radio" bind-input="{{'$Cache.pays.buy_method'}}" name="pay-type" value="face_pay" event-change="{{'$Event.pay.change_pay_method'}}" disabled="{{user.pay_ach.info.is_only_online_pay}}" />当面付款
                        <span>最便捷的消费方式</span>
                    </label>
                </div>
                <div class="pay-type">
                    <label style="cursor: pointer;">
                        <input checked="{{user.pay_ach.info.pay_method}}" type="radio" bind-input="{{'$Cache.pays.buy_method'}}" name="pay-type" value="weixin_pay" event-change="{{'$Event.pay.change_pay_method'}}" />微信支付
                        <span>使用微信扫描支付</span>
                    </label>
                </div>
                <!-- <div class="pay-type">
                                <input type="radio" name="pay-type" value="1" />邮局汇款
                                <span>通过快钱平台收款 汇款后1-3个工作日到账</span>
                            </div> -->
            </div>
            {{/if}}
        </div>

        <div class="item" style=" border-bottom: 1px solid #EEE;">
            <div class="title2">商品清单</div>
            <div class="info">
                <table>
                    <thead>
                        <td class="goods">商品</td>
                        <td class="price">价格</td>
                        <td class="discount">优惠</td>
                        <td class="count">数量</td>
                    </thead>
                    {{#each user.pay_ach.info.goods_info}}
                    <tr>
                        <td>
                            <div>
                                <a href="/goods-details.html?id={{goods._id}}#default/comments">{{goods.goods_name}}</a>
                            </div>
                            <div>
                                商品编号：{{goods._id}}
                            </div>
                        </td>
                        <td>
                            <!-- {{goods.cash||goods.price}} -->{{#Fixed goods.price}}</td>
                        <td>{{(goods.price-goods.cash)||0}}</td>
                        <td>{{num}}</td>
                    </tr>
                    {{/each}}
                </table>

                <div class="money">
                    <div class="money-item">
                        <div class="left">商品总金额：</div>
                        <div class="right">{{#Fixed user.pay_ach.sou_cash}}</div>
                    </div>
                    <div class="money-item">
                        <div class="left">打折优惠：</div>
                        <div class="right">{{#Fixed (user.pay_ach.sou_cash-(user.pay_ach.cash+user.pay_ach.bind_acc||0))||0}}</div>
                    </div>
                    <div class="money-item">
                        <div class="left">推荐返利金额抵消：</div>
                        <div class="right">{{#Fixed (user.pay_ach.bind_acc)||0}}</div>
                    </div>
                    <div class="money-item">
                        <div class="left">应付金额：</div>
                        <div class="right">
                            {{#if user.pay_ach.cus_cash}}
                            <span>
                                <del>{{#Fixed user.pay_ach.cash}}</del>
                                改：{{#Fixed user.pay_ach.cus_cash}}
                            </span>
                            {{#else}}
                            <span>{{#Fixed user.pay_ach.cash}}</span>
                            {{/if}}
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="item" style=" border-bottom: 1px solid #EEE;">
            <div class="title2">优惠码</div>
            <div class="coupon">
                {{#if user.pay_ach.coupon_id}} 使用优惠码：{{user.pay_ach.coupon_id}} {{#else}} {{#if user.pay_ach.info.state==$Top.config.ACH_STATE.未确认}}
                <label for="coupon">请输入优惠码：
                    <input type="text" class="android" value="{{$Cache.pay.pay_ach.coupon_id}}" bind-input="{{'$Cache.pay.pay_ach.coupon_id'}}">
                    <button event-click="{{'$Event.pay.pay_ach.bind_coupon'}}">绑定优惠码</button>
                    <i>绑定优惠码后不能再修改订单</i>
                </label>
                {{/if}} {{/if}}
            </div>
        </div>
        <div class="item" style=" border-bottom: 1px solid #EEE;">
            <div class="title2">返利抵扣</div>
            <div class="bus_bind">
                {{#if user.pay_ach.bind_acc}} 使用 <b>推荐返利</b> 的抵消金额：￥
                <span>{{#Fixed user.pay_ach.bind_acc}}</span>
                {{#else}} {{#if $Cache.pay.bus_bind._money>0}} 使用抵扣金额（可用抵扣金额：
                <span>￥{{#Fixed $Cache.pay.bus_bind._money}}</span>）：
                <inputnumber min="0" max="{{(user.pay_ach.cus_cash||user.pay_ach.cash)>$Cache.pay.bus_bind._money?$Cache.pay.bus_bind._money:(user.pay_ach.cus_cash||user.pay_ach.cash)}}" fixed="2" bind-input="{{'$Cache.pay.pay_ach.bind_acc'}}"></inputnumber>
                <button event-click="{{'$Event.pay.pay_ach.bind_acc'}}">确定抵扣金额</button>
                <i>确定后不能再修改抵扣额度</i>
                {{#else}}
                <i>无可用的抵扣金额（来自推荐返利）</i>
                {{/if}} {{/if}}
            </div>
        </div>

        <div class="item">
            {{#> "user_ach_controller","user.pay_ach"}}
        </div>

        <div class="subor {{submitOrder&&'focus'}}">
            <p>
                您的订单已提交，此对话框将在 {{init_time||'15'}} 秒后关闭
            </p>
            <p>
                您可以选择
                <a href="main-beta.html">继续购物</a>
                或
                <a href="personal-beta.html">查看订单</a>
            </p>
        </div>


    </div>
</div>
